#include "riscv.h"
#include "lib/print.h"
#include "proc/proc.h"
#include "dev/uart.h"

volatile static int started = 0;

int main()
{
    uart_init();
    if(mycpuid() == 0){
        printf("Hello os\n");
        started = 1;         // 标记系统启动完成
  } else {
    // 其他CPU等待CPU 0完成初始化
    while(started == 0)
      ;
    printf("hart %d starting\n", mycpuid());
  }
  return 0;
}